
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
    <meta name = "format-detection" content = "telephone=no">
    <title>购物车</title>
    <link rel="stylesheet" href="__CSS__/cart.css">
	<include file="Public/common_js"/>
</head>
<body>
<div class="warp" style="padding-bottom:3rem;">
    <!-- 配送地址 -->
    <div class="address">
        <div class="address-list">
            <!-- 无地址 -->
            <div class="address-none" style="display:none;">
                <h3>暂无收货地址</h3>
                <h4 class="tips">为方便您更快收货，请填写收货地址额！</h4>
            </div>
            <!-- 有地址 -->
            <div class="address-item">
                <h3>收货人：<span>怡臣君</span><span>15912344789</span></h3>
                <h4>收货地址:重庆市北碚区中北碚区中山路250号15f-20</h4>
            </div>
        </div>
    </div>
    <!-- 购物车内容 -->
    <div class="cart-content">
        <!-- 店铺分割 -->
        <volist name="cart_goods" id="acart">
        <div name="cart_goods" id="acart"  key="k">
        <div class="shop-cart">
            <div class="shop-choice">{$acart.local_name}</div>

            <volist name="acart.store" id="acart_goods">

                <if condition="$acart_goods.marketable eq '1' ">
                  <div class="shop-cart-list">
                <!-- 单个商品 -->
                <div class="single-item dataItem">
                    <div class="swipe-item">
                        <div class="choice-btn <if condition="$acart_goods.ischeck eq 1" >active</if>" value = "{$acart_goods.local_id},{$acart_goods.product_id}"></div>
                        <a href="" class="img"><img src="__IMAGE__/img_03.jpg" alt=""></a>
                        <div class="goods-text">
                            <a href="" class="name text-hide">{$acart_goods.name}</a>
                            <p class="norms">{$acart_goods.spec_info}</p>
                            <p class="price">¥{$acart_goods.price|number_format=###, 2, '.', ''}</p>
                            <p class="change-number">
                                <a href="javascript:void(0);" onclick="javascript:addCart({$acart_goods.id},{$acart_goods.local_id})" class="plus">+</a>
                                <input type="number" value="1">
                                <a href="javascript:void(0);" onclick="javascript:minusCart({$acart_goods.product_id},{$acart_goods.local_id})" class="minus">--</a>
                            </p>
                        </div>

                    </div>
                    <div class="static-item">
                        <a href="javascript:void(0);" class="delete">删除</a>
                        <a href="avascript:void(0);" class="collect">收藏</a>
                    </div>




                <!-- 单个失效商品 -->
                <!--<div class="single-outrange">
                    <div class="swipe-item">
                        <div class="choice-btn"></div>
                        <a href="" class="img"><img src="__IMAGE__/img_03.jpg" alt=""></a>
                        <div class="goods-text">
                            <a href="" class="name text-hide">Svans 蘑菇沙拉调Svans 蘑菇沙拉调</a>
                            <p class="norms">500g盒/原味</p>
                            <p class="notice">该商品不在配送区域</p>
                            <p class="price">¥75</p>
                            <p class="change-number">
                                <a href="javascript:void(0);" class="plus">+</a>
                                <input type="number" value="1">
                                <a href="javascript:void(0);" class="minus">&#45;&#45;</a>
                            </p>
                        </div>
                    </div>
                    <div class="static-item">
                        <a href="javascript:void(0);" class="delete">删除</a>
                        <a href="avascript:void(0);" class="collect">收藏</a>
                    </div>
                </div>--><!--<div class="single-outrange">
                    <div class="swipe-item">
                        <div class="choice-btn"></div>
                        <a href="" class="img"><img src="__IMAGE__/img_03.jpg" alt=""></a>
                        <div class="goods-text">
                            <a href="" class="name text-hide">Svans 蘑菇沙拉调Svans 蘑菇沙拉调</a>
                            <p class="norms">500g盒/原味</p>
                            <p class="notice">该商品不在配送区域</p>
                            <p class="price">¥75</p>
                            <p class="change-number">
                                <a href="javascript:void(0);" class="plus">+</a>
                                <input type="number" value="1">
                                <a href="javascript:void(0);" class="minus">&#45;&#45;</a>
                            </p>
                        </div>
                    </div>
                    <div class="static-item">
                        <a href="javascript:void(0);" class="delete">删除</a>
                        <a href="avascript:void(0);" class="collect">收藏</a>
                    </div>
                </div>-->
                <!-- 组合商品 -->
               <!-- <div class="group-item dataItem">
                    <div class="swipe-item">
                        <div class="group-des"><span>组合套餐</span>组合搭配购买，<label>立减200元</label></div>
                        <div class="item-box">
                            <div class="choice-btn"></div>
                            <div class="item-content">
                                <div class="goods-item">
                                    <a href="" class="img"><img src="__IMAGE__/img_03.jpg" alt=""></a>
                                    <div class="goods-text">
                                        <a href="" class="name text-hide">Svans 蘑菇沙拉调vans 蘑菇沙拉调</a>
                                        <p class="norms">500g盒/原味</p>
                                        <p class="price clearfix"><span class="fl">￥75</span><span class="fr">1</span></p>
                                    </div>
                                </div>
                                <div class="goods-item">
                                    <a href="" class="img"><img src="__IMAGE__/img_03.jpg" alt=""></a>
                                    <div class="goods-text">
                                        <a href="" class="name text-hide">Svans 蘑菇沙拉调vans 蘑菇沙拉调</a>
                                        <p class="norms">500g盒/原味</p>
                                        <p class="price clearfix"><span class="fl">￥75</span><span class="fr">3</span></p>
                                    </div>
                                </div>
                                <div class="group-total">
                                    <p class="fl">套餐价:<label>￥500</label></p>
                                    <p class="change-number">
                                        <a href="javascript:void(0);" class="plus">+</a>
                                        <input type="number" value="1">
                                        <a href="javascript:void(0);" class="minus">-</a>
                                    </p>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="static-item">
                        <a href="javascript:void(0);" class="delete">删除</a>

                    </div>
                </div>
                &lt;!&ndash; 组合商品失效 &ndash;&gt;
                <div class="group-outrange">
                    <div class="swipe-item">
                        <div class="group-des"><span>组合套餐</span>组合搭配购买，<label>立减200元</label></div>
                        <div class="item-box">
                            <div class="choice-btn"></div>
                            <div class="item-content">
                                <div class="goods-item">
                                    <a href="" class="img"><img src="__IMAGE__/img_03.jpg" alt=""></a>
                                    <div class="goods-text">
                                        <a href="" class="name text-hide">Svans 蘑菇沙拉调vans 蘑菇沙拉调</a>
                                        <p class="norms">500g盒/原味</p>
                                        <p class="notice">该商品不在配送区域</p>
                                        <p class="price clearfix"><span class="fl">￥75</span><span class="fr">5</span></p>
                                    </div>
                                </div>
                                <div class="goods-item">
                                    <a href="" class="img"><img src="__IMAGE__/img_03.jpg" alt=""></a>
                                    <div class="goods-text">
                                        <a href="" class="name text-hide">Svans 蘑菇沙拉调vans 蘑菇沙拉调</a>
                                        <p class="norms">500g盒/原味</p>
                                        <p class="notice">该商品不在配送区域</p>
                                        <p class="price clearfix"><span class="fl">￥75</span><span class="fr">2</span></p>
                                    </div>
                                </div>
                                <div class="group-total">
                                    <p class="fl">套餐价:<label>￥500</label></p>
                                    <p class="change-number">
                                        <a href="javascript:void(0);" class="plus">+</a>
                                        <input type="number" value="1">
                                        <a href="javascript:void(0);" class="minus">-</a>
                                    </p>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="static-item">
                        <a href="javascript:void(0);" class="delete">删除</a>
                    </div>
                </div>-->
            </div>
                </if>

            </volist>

            <div class="shop-settlement">
                <span>已选择2件商品</span>
                <span>应付:<label>￥200</label></span>
            </div>

        </div>
        </volist>
        <!-- 店铺分割 -->

        <!-- 过期商品 -->
        <div class="outTime-goods mgTop">


                <volist name="cart_goods" id="acart"  key="k">
                    <volist name="acart.store" id="acart_goods">
                        <if condition="$acart_goods.marketable eq '0' ">
                            <div class="outTime-item clearfix">
                                <div class="out-label"></div>
                                <img src="__IMAGE__/img_04.jpg" alt="">
                                <div class="goods-text">
                                    <p class="name text-hide">{$acart_goods.name}</p>
                                    <p class="norms">{$acart_goods.spec_info}</p>
                                    <a href="javascript:void(0);" class="delete">删除</a>
                                </div>
                            </div>
                        </if>
                     </volist>
                </volist>


            <div class="outTime-all">
                <a href="javascript:clearGoods()">清除失效商品</a>
            </div>




        </div>
    </div>
</div>
<!-- 购物车合计 -->
<div class="cart-settment clearfix">
    <div class="left-text">
        <a href="javascript:void(0);" class="all-choice">全选</a>
        <div>
            <h2>合计：<label>￥456315.15</label></h2>
            <h5>(不含运费，全场满59元包邮)</h5>
        </div>
    </div>
    <a href=""  class="settment-btn">结算</a>
</div>
<!-- 编辑状态下底部选择 -->
<div class="fixed-bot-modify" style="display:none;">
    <div class="left-text">
        <a href="javascript:void(0);" class="all-delete">全选</a>
    </div>
    <div class="right-operate">
        <a href="javascript:void(0);" class="delete-btn">删除</a>
        <a href="" class="like-btn">移入喜欢</a>
    </div>
</div>
<!-- 右侧浮动按钮 -->
<div class="fixed-right-btn">
    <a href="javascript:void(0);" class="fixed-modify">编辑</a>
    <a href="javascript:void(0);" class="fixed-complete" style="display:none;">完成</a>
</div>
<!-- 提示弹窗 -->
<div class="alert-popup">
    <p>是否从购物车删除所选商品</p>
    <p><a href="javascript:void(0);" class="cancel">取消</a><a href="javascript:void(0);" class="confirm" onclick="deleteCart();">确定</a></p>
</div>
<!-- 网站主菜单 -->
<div class="fixed-main-menu">
    <a href="" class="home"><span></span><p>首页</p></a>
    <a href="" class="category"><span></span><p>分类</p></a>
    <a href="" class="cart active"><span></span><p>购物车</p></a>
    <a href="" class="mine"><span></span><p>我的</p></a>
</div>
<script type="text/javascript">
	require(['cart']);
</script>
<script>
    function deleteCart(){
        $('.cart-content').remove();
    }

    function addCart(pid,local_id) {

        $.ajax({
            url:"{:u('home/carts/cart_add_num')}",
            type:'post',
            data:{'pid': pid,'local_id':local_id},
            dataType:'json',
            success:function(data){
                if(data.status =1){
                    // location.href = data.url;
                }
            },
            error:function(err){
                alert(pid);
                alert(err.toString());
            }
        });
    }
    function minusCart() {

        $.ajax({
            url:"{:u('home/carts/cart_add_num')}",
            type:'post',
            data:{'pid': goodsInfo.pid,'goods_id':goodsInfo.gid},
            dataType:'json',
            success:function(data){
                if(data.status =1){
                    // location.href = data.url;
                }
            },
            error:function(err){
                alert(err.toString());
            }
        });
    }
    function clearGoods() {
        $.ajax({
            url:"{:U('home/carts/clearGoods')}",
            type:'post',
            datatype:'json',
            success:function () {
                   if(data.status =1){
                       return true;
                   }
            },
            error:function (err) {
                alert(err.toString());
            }

        })
    }


</script>
</body>
</html>

